package com.hs.test.cicd;

import com.hs.framework.BaseTest;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.parallel.Execution;
import org.junit.jupiter.api.parallel.ExecutionMode;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

import java.util.Map;

@Execution(ExecutionMode.CONCURRENT)
public class AndroidSampleApp2Deploy extends BaseTest {

    @ParameterizedTest
    @ValueSource(strings = {"SamSung1", "SamSung2"})
    public void installAppAndroid(String deviceName) throws Exception {
        String appId = hsAPI.getAppIdByBuildCommit(androidBuildCommit);
        String udid = hsAPI.getDeviceUdidByLocalName(deviceName);
        hsAPI.uninstallApp(udid, appPackage, true);
        Map<String, Object> ret = hsAPI.installPreUploadApp(udid, appId, false);
        Assertions.assertEquals(200, ret.get("code"));
    }

}


